/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"DA939B67-8E61-47C8-8BE2-170D429FACF2"}
 */
var fLetra = 'X';

/**
 * @type {Number}
 *
 * @properties={typeid:35,uuid:"0DB6F797-70DE-47AC-BD97-38D8A01007E0",variableType:4}
 */
var fNroRecibo = null;

/**
 * @type {Number}
 *
 * @properties={typeid:35,uuid:"A6860E22-250C-4BCD-84AB-EB554B89B9FB",variableType:4}
 */
var fSucursal;

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"E4273891-1B08-42FE-9E0D-2EBAD25A7356"}
 * @AllowToRunInFind
 */
function buscar(event) 
{
	var estado_find = forms.rec_baja_2.controller.find()
	if (estado_find == false)
	{
		globals.DIALOGS.showWarningDialog('Aviso','No encontró recibos','OK')
		return;
	}
	
	forms.rec_baja_2.letra 				= fLetra
	forms.rec_baja_2.sucursal 			= fSucursal
	forms.rec_baja_2.nro_comprobante 	= fNroRecibo
	
	var f = forms.rec_baja_2.controller.search()
	if (f != 0)
	{
		globals.formEnVentana('rec_baja_2','recibos','Recibo Nº'+fNroRecibo)
	}
	else
		globals.DIALOGS.showWarningDialog('Aviso','No se encontraron recibos','OK')
}

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"4859C054-9F42-4604-92F7-BAE057E29700"}
 */
function iniciar(firstShow, event) 
{
	fNroRecibo = null;
	fSucursal = globals.gSucursal;
}
